﻿#pragma once

#include "../../MirControls/MirImageControl.h"
#include "../../MirControls/MirLabel.h"
#include "../../MirControls/MirButton.h"
#include "../../MirControls/MirAnimatedControl.h"
#include "../../MirControls/MirItemCell.h"
#include <vector>
#include <any>
#include "../../../stringhelper.h"

using namespace Client::MirControls;
using namespace Client::MirGraphics;
using namespace Client::MirNetwork;
using namespace Client::MirObjects;
using namespace Client::MirSounds;
namespace C = ClientPackets;

namespace Client::MirScenes::Dialogs
{
    class MountDialog final : public MirImageControl
    {
    public:
        MirLabel *MountName, *MountLoyalty;
        MirButton *CloseButton, *MountButton, *HelpButton;
    private:
        MirAnimatedControl *MountImage;
    public:
        std::vector<MirItemCell*> Grid;

        int StartIndex = 0;

        virtual ~MountDialog()
        {
            delete MountName;
            delete MountLoyalty;
            delete CloseButton;
            delete MountButton;
            delete HelpButton;
            delete MountImage;
        }

        MountDialog();

    private:
        void MountDialog_BeforeDraw(std::any sender, EventArgs *e);

    public:
        void RefreshDialog();

    private:
        void SwitchType();

        void DrawMountAnimation();

    public:
        bool CanRide();

        void Ride();

        void Show() override;

        MirItemCell *GetCell(unsigned long long id);
    };
}
